package io.jpress.module.demo;

import com.jfinal.core.Controller;
import io.jpress.core.menu.MenuGroup;
import io.jpress.core.module.ModuleListener;

import java.util.List;

public class DemoModuleListener implements ModuleListener {


    @Override
    public String onRenderDashboardBox(Controller controller) {
        return null;
    }

    @Override
    public String onRenderToolsBox(Controller controller) {
        return null;
    }

    @Override
    public void onConfigAdminMenu(List<MenuGroup> adminMenus) {
        MenuGroup menuGroup = new MenuGroup();
        menuGroup.setId("device");
        menuGroup.setText("设备管理");
        menuGroup.setIcon("<i class=\"fa fa-fw fa-file-text\"></i>");
        menuGroup.setOrder(3);
        adminMenus.add(menuGroup);
        menuGroup = new MenuGroup();
        menuGroup.setId("link");
        menuGroup.setText("数据链路管理");
        menuGroup.setIcon("<i class=\"fa fa-fw fa-file-text\"></i>");
        menuGroup.setOrder(4);
        adminMenus.add(menuGroup);
        menuGroup = new MenuGroup();
        menuGroup.setId("person");
        menuGroup.setText("人员管理");
        menuGroup.setIcon("<i class=\"fa fa-fw fa-file-text\"></i>");
        menuGroup.setOrder(5);
        adminMenus.add(menuGroup);
    }

    @Override
    public void onConfigUcenterMenu(List<MenuGroup> ucenterMenus) {
        MenuGroup menuGroup = new MenuGroup();
        menuGroup.setId("demo");
        menuGroup.setText("测试菜单1");
        menuGroup.setIcon("<i class=\"fa fa-fw fa-file-text\"></i>");
        menuGroup.setOrder(1);
        ucenterMenus.add(menuGroup);


        MenuGroup commentMenuGroup = new MenuGroup();
        commentMenuGroup.setId("comment");
        commentMenuGroup.setText("测试菜单2");
        commentMenuGroup.setIcon("<i class=\"fa fa-fw fa-commenting\"></i>");
        commentMenuGroup.setOrder(2);
        ucenterMenus.add(commentMenuGroup);
    }
}
